Add SQL-Redis GEO and Date Query Support#533
Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
There was a problem hiding this comment.
Pull request overview
Adds GEO radius filtering and date/timestamp querying examples to RedisVL’s SQL interface (via the optional sql-redis dependency), along with integration tests and docs updates to demonstrate/validate the new query patterns.
Changes:
- Bumps optional dependency
sql-redisto>=0.3.0(and includes it in theallextra). - Adds integration tests for
geo_distance(...)queries and basic date literal /BETWEEN/YEAR()usage. - Expands SQL documentation and the SQL-to-Redis notebook with GEO and date query examples.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| tests/integration/test_sql_redis_hash.py | Adds new integration coverage for GEO queries and date literal/date function patterns. |
| pyproject.toml | Bumps sql-redis optional dependency version; adds Hatch metadata setting. |
| docs/user_guide/12_sql_to_redis_queries.ipynb | Adds extensive GEO and date query tutorial content and examples. |
| docs/concepts/queries.md | Adds SQLQuery examples for aggregations, GEO, and date queries plus a link to the notebook. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
3393fdc to
81e558b
Compare
81e558b to
e454e0d
Compare
3cd52a0 to
7358866
Compare
There was a problem hiding this comment.
Pull request overview
Adds GEO radius and date/timestamp querying support to RedisVL’s SQL interface (via the optional sql-redis extra), along with expanded documentation and integration coverage to validate translation/execution behavior.
Changes:
- Bump optional dependency to
sql-redis>=0.3.0(and update theallextra accordingly). - Add integration tests covering
geo_distance()filters/aggregations and date literal/date function handling (e.g.,BETWEEN,YEAR()). - Expand the SQL user guide notebook and concepts docs with GEO and date query examples.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/integration/test_sql_redis_hash.py | Adds integration tests for GEO and date SQL translation/execution. |
| pyproject.toml | Updates redisvl[sql-redis] extra to require sql-redis>=0.3.0. |
| docs/user_guide/12_sql_to_redis_queries.ipynb | Expands the SQL notebook with GEO/date sections and examples; updates outputs/metadata. |
| docs/concepts/queries.md | Adds SQL examples for aggregation, GEO, and date querying; links to the SQL notebook guide. |
Comments suppressed due to low confidence (2)
docs/user_guide/12_sql_to_redis_queries.ipynb:762
- The generated query/output uses the alias
fist_value_age(missing the 'r' in 'first'). Even if it’s just an example, this typo propagates into the displayed Redis query and result keys; rename it tofirst_value_agein the SQL so the docs show the correct alias.
"metadata": {},
"source": [
docs/user_guide/12_sql_to_redis_queries.ipynb:179
- The notebook still introduces a "Validate data entries on load" section, but the preceding
SearchIndex.from_dict(...)examples no longer passvalidate_on_load=True, so the narrative/example is inconsistent. Either re-addvalidate_on_load=Truein the index construction snippets or adjust the section text to explain that validation is disabled in this guide and how to enable it if desired.
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Bring your own Redis connection instance\n",
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
7358866 to
3bcedd0
Compare
3bcedd0 to
3d2af53
Compare
There was a problem hiding this comment.
Pull request overview
Adds GEO and date/time query support coverage for RedisVL’s SQLQuery path (via the optional sql-redis dependency), along with expanded documentation and integration tests to validate new SQL-to-Redis translations.
Changes:
- Bump optional dependency
sql-redisto>=0.3.0(and update theallextra). - Add integration tests for
geo_distance()filters/SELECT distance and date literals +YEAR()+GROUP BY. - Expand SQL user guide notebook and concepts docs with GEO/date examples and summaries.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
tests/integration/test_sql_redis_hash.py |
Adds new integration fixtures + tests covering GEO radius filters, geo_distance() in SELECT (aggregate), ISO date literals, YEAR() extraction, and grouping. |
pyproject.toml |
Updates the sql-redis optional extra (and all) to require >=0.3.0. |
docs/user_guide/12_sql_to_redis_queries.ipynb |
Major expansion of the SQL guide with GEO + date querying examples, plus native GEO filter comparisons. |
docs/concepts/queries.md |
Adds SQLQuery examples for aggregations, GEO, and date queries, and links to the expanded notebook. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
3d2af53 to
01936fd
Compare
01936fd to
ca042d7
Compare
5808689 to
c99c943
Compare
There was a problem hiding this comment.
Pull request overview
Adds GEO distance querying and date/timestamp querying support to RedisVL’s SQL interface by upgrading the optional sql-redis translator dependency and expanding docs/examples and integration coverage.
Changes:
- Bump optional dependency
sql-redisto>=0.3.0. - Add new SQLQuery integration tests for GEO radius filtering and date literal /
YEAR()behavior. - Expand SQL-to-Redis notebook and concepts docs with GEO and date query examples.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
tests/integration/test_sql_redis_hash.py |
Adds GEO and date/timestamp integration tests for SQLQuery translation/execution. |
pyproject.toml |
Updates sql-redis optional dependency (and all) to >=0.3.0. |
docs/user_guide/12_sql_to_redis_queries.ipynb |
Extends the SQL guide with GEO and date examples, plus native Geo filter comparisons. |
docs/concepts/queries.md |
Adds SQL examples for aggregations, GEO, date functions, and links to the SQL guide. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
c99c943 to
45e2566
Compare
45e2566 to
f1dc967
Compare
f1dc967 to
54b8c78
Compare
There was a problem hiding this comment.
Pull request overview
This PR expands RedisVL’s SQLQuery integration (via the optional sql-redis dependency) to cover GEO distance queries and date/timestamp literals/functions, and documents these capabilities with updated guides and examples.
Changes:
- Bump optional dependency to
sql-redis>=0.3.0(includingredisvl[all]). - Add integration tests for
geo_distance()filters/SELECT projections and date literal/function handling (e.g.,YEAR(),BETWEEN,GROUP BY). - Expand the SQL-to-Redis user guide notebook and add SQL examples to the queries concept doc.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/integration/test_sql_redis_hash.py | Adds GEO and date/timestamp SQLQuery integration tests. |
| pyproject.toml | Updates optional dependency minimum version for sql-redis. |
| docs/user_guide/12_sql_to_redis_queries.ipynb | Extends the SQL guide with GEO + date examples and translations. |
| docs/concepts/queries.md | Adds SQLQuery examples for aggregations, GEO, date queries, and vector params, plus a link to the notebook. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
54b8c78 to
f8238a1
Compare
f8238a1 to
2c0e279
Compare
There was a problem hiding this comment.
Pull request overview
Adds GEO-radius and date/timestamp query support examples to RedisVL’s SQL interface by bumping the optional sql-redis dependency and extending integration tests/docs to cover geo_distance() and date literals/functions.
Changes:
- Bump optional dependency to
sql-redis>=0.3.0(and alignallextra accordingly). - Add integration tests for GEO distance filtering/selection and date literal +
YEAR()usage (includingGROUP BY). - Expand SQLQuery documentation/examples in the SQL notebook and query concepts page.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
tests/integration/test_sql_redis_hash.py |
Adds GEO and date/timestamp integration coverage for SQLQuery translation/execution. |
pyproject.toml |
Updates optional dependency constraints for sql-redis (and all extra). |
docs/user_guide/12_sql_to_redis_queries.ipynb |
Expands the SQL-to-Redis guide with GEO + date query patterns and examples. |
docs/concepts/queries.md |
Adds SQLQuery examples for aggregations, GEO, and date queries + link to the notebook. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| sql-redis = [ | ||
| "sql-redis>=0.2.0", | ||
| "sql-redis>=0.3.0", | ||
| ] |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
2c0e279 to
99477b6
Compare

Add SQL-Redis GEO and Date Query Support
Summary
Adds comprehensive GEO and Date query support to RedisVL's SQL interface via the sql-redis optional dependency.
Changes
Dependencies
Add sql-redis>=0.3.0 as optional dependency (pip install redisvl[sql-redis])
Documentation
Example:
GEO Query Support
Operators
<WHERE geo_distance(location, POINT(lon, lat), 'km') < 50<=WHERE geo_distance(location, POINT(lon, lat), 'km') <= 50>WHERE geo_distance(location, POINT(lon, lat), 'km') > 10>=WHERE geo_distance(location, POINT(lon, lat), 'km') >= 10BETWEENWHERE geo_distance(location, POINT(lon, lat), 'km') BETWEEN 10 AND 50Units
geo_distance(location, POINT(-122.4, 37.8), 'km')geo_distance(location, POINT(-122.4, 37.8), 'mi')geo_distance(location, POINT(-122.4, 37.8), 'm')geo_distance(location, POINT(-122.4, 37.8), 'ft')Distance Calculation in SELECT
Combined Filters
Date Query Support
Operators with Date Literals
>WHERE created_at > '2024-01-01'>=WHERE created_at >= '2024-01-01'<WHERE created_at < '2024-12-31'<=WHERE created_at <= '2024-12-31'=WHERE created_at = '2024-01-01'BETWEENWHERE created_at BETWEEN '2024-01-01' AND '2024-03-31'Date Functions in SELECT
YEAR()SELECT YEAR(created_at) AS yearAPPLY year(@created_at) AS yearMONTH()SELECT MONTH(created_at) AS monthAPPLY monthofyear(@created_at) AS monthDAY()SELECT DAY(created_at) AS dayAPPLY dayofmonth(@created_at) AS dayDATE_FORMAT()SELECT DATE_FORMAT(created_at, '%Y-%m-%d') AS dateAPPLY timefmt(@created_at, "%Y-%m-%d") AS dateDate Functions in WHERE
Date Functions in GROUP BY
Combined Filters
Notes
'2024-01-01') are automatically converted to Unix timestampsPOINT(longitude, latitude)format (lon first)geo_distance()in SELECT returns distance in meters by defaultNote
Medium Risk
Updates the optional
sql-redisdependency and expands SQLQuery coverage to GEO and date/timestamp translation, which can affect query generation/compatibility for users enablingredisvl[sql-redis]. Risk is moderated by being optional and backed by new integration tests.Overview
Expands
SQLQuerycapabilities (viasql-redis) to cover geographic and date/time querying. Documentation now includes examples forgeo_distance()radius filters and distance calculations, ISO date literal filtering, and date functions likeYEAR()plus grouping.Bumps the optional dependency to
sql-redis>=0.3.0, updates the SQL guide notebook with end-to-end GEO/date examples (including notes about GEO validation and coordinate order), and adds integration tests validating GEO filtering/selection translation (GEOFILTER/FT.AGGREGATE) and date literal +YEAR()/GROUP BYbehavior.Written by Cursor Bugbot for commit 99477b6. This will update automatically on new commits. Configure here.